package com.iwhalecloud.citybrain.flow.platform.manager.application.service;

import com.iwhalecloud.citybrain.flow.platform.manager.common.client.HttpCommandDto;
import com.iwhalecloud.citybrain.flow.platform.manager.common.client.HttpCommandResultDto;

/**
 * @author lilh
 * @date 2019-02-19 15:58
 */
public interface CommandHandler {

    /** 创建流程实例 */
    String CREATE_PROCESS_INSTANCE = "createProcessInstance";

    /** 指定参与人 */
    String SET_PARTICIPANTS = "setParticipants";

    /** 启动流程实例 */
    String START_PROCESS_INSTANCE = "startProcessInstance";

    /** 办理工单 */
    String COMPLETE_WORK_ITEM = "completeWorkItem";

    /** 结束流程实例 */
    String TERMINATE_PROCESS_INSTANCE = "terminateProcessInstance";

    /** 将任务重新分配给指定的人 */
    String DISPATCH_WORK_ITEM = "dispatchWorkItem";

    /** 终止流程实例 */
    String ABORT_PROCESS_INSTANCE = "abortProcessInstance";

    /** 任务回退 */
    String TASK_ROLLBACK = "taskRollback";

    /** 通知设置 */
    String TASK_NOTICE_SETTING = "taskNoticeSetting";

    String TASK_LIST = "taskListQuery";

    String MY_APPLY = "myApply";

    String PROCESS_INSTANCE_HANDLE_REL = "processInstanceHandleRel";

    String CREATE_PROCESS_INSTANCE_SUCCESS = "创建流程实例成功";

    String SET_PARTICIPANTS_SUCCESS = "指定参与人成功";

    String START_PROCESS_INSTANCE_SUCCESS = "启动流程实例成功";

    String COMPLETE_WORK_ITEM_SUCCESS = "办理工单成功";

    String TERMINATE_PROCESS_INSTANCE_SUCCESS = "结束流程实例成功";

    String TASK_ROLLBACK_SUCCESS = "回退成功";

    String TASK_NOTICE_SETTING_SUCCESS = "通知设置成功";

    /**
     * 处理类型
     *
     * @return 处理类型
     */
    String handleType();

    /**
     * 处理
     *
     * @param params 参数
     * @return 处理结果
     */
    HttpCommandResultDto handle(String params);

    /**
     * 处理
     *
     * @param commandDto 参数
     * @return 处理结果
     */
    HttpCommandResultDto handle(HttpCommandDto commandDto);
}
